import {INavigator} from "./NavigatorTypes";
import {Platform} from "react-native";
import WebNavigator from "./support/WebNavigator";


class NavigatorFactory {
    public static create(): INavigator | never {
        if (Platform.OS === 'web') {
            return new WebNavigator();
        } else if (Platform.OS === 'android' || Platform.OS === 'ios') {
            // return new NativeNavigator();
            throw new Error('only on web.');
            // return new NativeNavigator();
        }

        throw new Error();
    }
}

const NavigatorBar: INavigator = NavigatorFactory.create();
export default NavigatorBar;
